package com.zhu.designpatterns.creational.abstractfactory;

/**
 * @author ZhuXinYe
 * @date 2022/8/28 16:51
 * @description 具体工厂Truck
 **/
public class FactoryClient
{

	public static void main(String[] args)
	{
		//创建具体的工厂
		CarFactory blueCarFactory = new BlueCarFactory();
		//生产相对应的产品
		Car blueSuv = blueCarFactory.getSuv();
		Car blueTruck = blueCarFactory.getTruck();
		System.out.println("生产相对应的产品为:" + blueSuv.getName());
		System.out.println("生产相对应的产品为:" + blueTruck.getName());

		CarFactory redCarFactory = new RedCarFactory();
		Car redSuv = redCarFactory.getSuv();
		Car redTruck = redCarFactory.getTruck();
		System.out.println("生产相对应的产品为:" + redSuv.getName());
		System.out.println("生产相对应的产品为:" + redTruck.getName());
	}
}
